package com.wyp168.juc;

/**
 * @ClassName InheritableThreadLocalDemo002
 * @Description TODO
 * @Author wyp168
 * @Date 2022/8/5 17:56
 */
public class InheritableThreadLocalDemo002 {
    private static InheritableThreadLocal<String> threadLocal = new InheritableThreadLocal<>();

    public static void main(String[] args) {

            Thread threadA = new Thread(() -> {
                System.out.println(threadLocal.get());
            });
        threadLocal.set("main ThreadLocalVariable");
            threadA.start();

        System.out.println(threadLocal.get());

    }
}
